An instance of POCS can be loaded and run as a simulator, which will then allow you to play with various aspects of of POCS and allow all of the different parts of the system.

Any INFO level log messages will be displayed in the notebook but you can check $PANDIR/logs/panoptes.log for full debug output


In [1]:
# Load the POCS module
from pocs import POCS

In [2]:
# Create an instance of POCS that acts as a simulator
pocs = POCS(simulator=['all']) # Could be a list of: 'weather', 'camera', 'mount'


2016-11-29 12:29:19 ganymede panoptes[24487] INFO Loading state table: simple_state_table
2016-11-29 12:29:20 ganymede panoptes[24487] INFO ********************************************************************************
2016-11-29 12:29:20 ganymede panoptes[24487] INFO Initializing PANOPTES unit
2016-11-29 12:29:20 ganymede panoptes[24487] INFO Welcome GeeBot!
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 	 observatory
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 	Initializing observatory
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 		 Setting up location
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 		 Setting up mount
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 		Using simulator mount
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 		 Setting up cameras
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 		 Setting up scheduler
2016-11-29 12:29:20 ganymede panoptes[24487] INFO 	 Observatory initialized
2016-11-29 12:29:22 ganymede root[24487] INFO PANCHAT Hi there!

The pocs instance needs to be initialized, which will set up the cameras, mount, scheduler, etc.


In [3]:
pocs.initialize()


2016-11-29 12:29:22 ganymede root[24487] INFO PANCHAT Initializing the system! Woohoo!
Out[3]:
True

During automated operations a script would simply call pocs.run() and the state machine would begin. However, the run() method is a blocking call so you can't interact with the system any more. Here we manually inspect some items.


In [4]:
# Check if we have a current observation:
print(pocs.observatory.current_observation)


None

In [5]:
# Get an observation by running the scheduler. Check the log file for details
new_obs = pocs.observatory.get_observation()


2016-11-29 12:29:38 ganymede panoptes[24487] INFO Setting new observation to Kepler 1100: 120.0 s exposures in blocks of 10, minimum 60, priority 125

In [6]:
print(pocs.observatory.current_observation)


Kepler 1100: 120.0 s exposures in blocks of 10, minimum 60, priority 125

In [7]:
# Set a new high priority target. (NOTE this is a totally fake thing)
target = {
    'name': 'Super Grav Wave Event',
    'position': '22h57m47.0s +38d40m30.0s',
    'priority': 999,    
}

pocs.observatory.scheduler.add_observation(target)

In [8]:
# Get a new observation, which should be our new event
new_obs = pocs.observatory.get_observation()


2016-11-29 12:29:53 ganymede panoptes[24487] INFO Setting new observation to Super Grav Wave Event: 120.0 s exposures in blocks of 10, minimum 60, priority 999

In [9]:
pocs.observatory.scheduler.remove_observation('Super Grav Wave Event')

In [10]:
pocs.observatory.scheduler.observations


Out[10]:
{'EPIC-211089792': <pocs.scheduler.observation.Observation at 0x7f7a85418eb8>,
 'HAT-P-1': <pocs.scheduler.observation.Observation at 0x7f7a85421e10>,
 'HAT-P-20': <pocs.scheduler.observation.Observation at 0x7f7a853f8b38>,
 'HD 189733': <pocs.scheduler.observation.Observation at 0x7f7a87558c50>,
 'HD 209458': <pocs.scheduler.observation.Observation at 0x7f7a8755acc0>,
 'KIC 8462852': <pocs.scheduler.observation.Observation at 0x7f7a85b84710>,
 'Kepler 1100': <pocs.scheduler.observation.Observation at 0x7f7a85b83710>,
 'M42': <pocs.scheduler.observation.Observation at 0x7f7a85428898>,
 'M44': <pocs.scheduler.observation.Observation at 0x7f7a85431828>,
 'M45': <pocs.scheduler.observation.Observation at 0x7f7a845057b8>,
 'M5': <pocs.scheduler.observation.Observation at 0x7f7a8450d748>,
 'Qatar-1': <pocs.scheduler.observation.Observation at 0x7f7a85423a90>,
 'Tres 3': <pocs.scheduler.observation.Observation at 0x7f7a8540ff28>,
 'Wasp 104': <pocs.scheduler.observation.Observation at 0x7f7a8751c630>,
 'Wasp 11': <pocs.scheduler.observation.Observation at 0x7f7a865c8be0>,
 'Wasp 140': <pocs.scheduler.observation.Observation at 0x7f7a8751c5c0>,
 'Wasp 2': <pocs.scheduler.observation.Observation at 0x7f7a865bbb38>,
 'Wasp 33': <pocs.scheduler.observation.Observation at 0x7f7a865b1cc0>,
 'Wasp 35': <pocs.scheduler.observation.Observation at 0x7f7a853f8b70>,
 'Wasp 36': <pocs.scheduler.observation.Observation at 0x7f7a865bcc50>,
 'Wasp 44': <pocs.scheduler.observation.Observation at 0x7f7a8751ee48>,
 'Wasp 77': <pocs.scheduler.observation.Observation at 0x7f7a865a5d30>}